In [1]:
%matplotlib notebook
In [2]:
import multicell
import numpy as np
In [3]:
sim = multicell.simulation_builder.generate_cell_grid_sim(20, 20, 1, 1e-3)
In [4]:
sim.register_cell_variable("a")
sim.register_cell_variable("h")
In [5]:
def c_a2(c_a, **kwargs):
return c_a ** 2
sim.register_computed_variable("c_a2", c_a2)
In [6]:
sim.set_constants({"mu_a": 1e-1, "mu_h": 2e-1, "rho_a": 1., "rho_h": 1., "q": 1., "H": 0.35, "A": 0., "D_h": 5., "D_a": 0.025})
In [7]:
def da_dt(simulation, a, c_a, c_a2, c_h, D_a, mu_a, rho_a, A, q, adjacency_matrix, **kwargs):
return simulation.diffusion(D_a, c_a, adjacency_matrix) + rho_a * c_a2 / c_h / (1 + q**2 * c_a2) - mu_a * a + A
def dh_dt(simulation, h, c_a2, c_h, D_h, mu_h, rho_h, H, adjacency_matrix, **kwargs):
return simulation.diffusion(D_h, c_h, adjacency_matrix) + rho_h * c_a2 - mu_h * h + H
sim.set_ODE("a", da_dt)
sim.set_ODE("h", dh_dt)
In [8]:
sim.initialize_cell_variables()
a0 = np.full(sim.n_cells, 0.789)
h0 = np.full(sim.n_cells, 4.863)
sim.set_cell_variable("a", a0)
sim.set_cell_variable("h", h0)
In [9]:
sim.set_duration(1e8)
In [10]:
sim.enable_growth(n_steps=11)
sim.register_growth_method(multicell.growth.linear_growth, {"coefficient": [1.1, 1.05, 1.]})
In [11]:
sim.enable_division()
sim.register_division_method(multicell.division.symmetrical_division)
sim.register_division_trigger(multicell.division.volume_trigger, {"volume_threshold": 2.})
In [12]:
sim.register_renderer(multicell.rendering.MatplotlibRenderer, "c_a", {"max_cmap": 1.3, "view_size": 60, "view": (90, -90), "axes": False})
In [13]:
sim.renderer.display("c_a")
In [14]:
sim.simulate()
We can see that as the tissue grows and the cells divide, new ridges of activator engulf into the valleys widened by growth.
Cell divisions do not directly trigger the reorganization of the pattern, because the spatial distribution of chemical species does not actually change (new cells have the same concentrations as former cells and occupy the same space). However, they do modify how far the inhibitor can reach, relatively to the pattern previously achieved. Where it cannot reach, the activator starts being expressed.